package com.sky.mapper;

import com.github.pagehelper.Page;
import com.sky.annotate.AutoFill;
import com.sky.entity.Employee;
import com.sky.enumeration.OperationType;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface EmployeeMapper {

    /**
     * 根据用户名查询员工
     *
     * @param username
     * @return
     */

    Employee getByUsername(String username);

    Page<Employee> pageSelectEmployee(Employee employee);

    @AutoFill(OperationType.INSERT)
    void insertEmployee(Employee employee);

    @AutoFill(OperationType.UPDATE)
    void updateEmployee(Employee employee);

    Employee selectByEmployeeId(Integer id);

    Employee checkPassword(String oldPassword, Long id);
}
